
<style>
    #sidebar-nav .nav li .submenu > li > a.active{
        background-color: #313131;
    }
</style>

<div class="col-md-2" id="nav-col">
    <section id="col-left">
        <div class="collapse navbar-collapse navbar-ex1-collapse" id="sidebar-nav">
            <ul class="nav nav-pills nav-stacked" id="menulist">
                <li>
                    <a href="{:url('Index/index')}" class="tmp">
                        <i class="fa fa-dashboard"></i>
                        <span>首页</span>
                    </a>
                </li>
                {if condition="in_array('Admin/index',$ownways) or in_array('Dept/index',$ownways) or in_array('Role/index',$ownways)"}
                <li>
                    <a href="#" class="dropdown-toggle">
                        <i class="fa fa-users"></i>
                        <span>系统管理</span>
                        <i class="fa fa-chevron-circle-down drop-icon"></i>
                    </a>
                    <ul class="submenu">
                        <!--超级管理员管理菜单-->
                        {if condition="$status eq '0'"}
                        <li>
                            <a href="{:url('Way/index')}" class="tmp">
                                操作菜单管理
                            </a>
                        </li>
                        {/if}
                        {if condition="in_array('Role/index',$ownways)"}
                        <li>
                            <a href="{:url('Role/index')}" class="tmp">
                                角色管理
                            </a>
                        </li>
                        {/if}
                        {if condition="in_array('Dept/index',$ownways)"}
                        <li>
                            <a href="{:url('Dept/index')}" class="tmp">
                                部门管理
                            </a>
                        </li>
                        {/if}
                        {if condition="in_array('Admin/index',$ownways)"}
                        <li>
                            <a href="{:url('Admin/index')}" class="tmp">
                                用户管理
                            </a>
                        </li>
                        {/if}
                    </ul>
                </li>
                {/if}
                {if condition="(in_array('Fitting/index',$ownways)) or (in_array('Client/index',$ownways))
                or (in_array('Program/index',$ownways) or (in_array('MeterType/index',$ownways))
                or (in_array('ModelType/index',$ownways)) or (in_array('Principle/index',$ownways)))"}
                <li>
                    <a href="#" class="dropdown-toggle">
                        <i class="fa fa-cogs"></i>
                        <span>可配置项管理</span>
                        <i class="fa fa-chevron-circle-down drop-icon"></i>
                    </a>
                    <ul class="submenu">
                        {if condition="in_array('State/index',$ownways)"}
                        <li>
                            <a href="{:url('State/index')}" class="tmp">
                                国家管理
                            </a>
                        </li>
                        {/if}
                        {if condition="in_array('Client/index',$ownways)"}
                        <li>
                            <a href="{:url('Client/index')}" class="tmp">
                                客户管理
                            </a>
                        </li>
                        {/if}
                        {if condition="in_array('MeterType/index',$ownways)"}
                        <li>
                            <a href="{:url('MeterType/index')}" class="tmp">
                                基表型号管理
                            </a>
                        </li>
                        {/if}
                        {if condition="in_array('ModelType/index',$ownways)"}
                        <li>
                            <a href="{:url('ModelType/index')}" class="tmp">
                                电子模块类型管理
                            </a>
                        </li>
                        {/if}
                        {if condition="in_array('Manu/index',$ownways)"}
                        <li>
                            <a href="{:url('Manu/index')}" class="tmp">
                                制造商管理
                            </a>
                        </li>
                        {/if}
                        {if condition="in_array('Principle/index',$ownways)"}
                        <li>
                            <a href="{:url('Principle/index')}" class="tmp">
                                生产负责人管理
                            </a>
                        </li>
                        {/if}
                        {if condition="in_array('Fitting/index',$ownways)"}
                        <li>
                            <a href="{:url('Fitting/index')}" class="tmp">
                                配件管理
                            </a>
                        </li>
                        {/if}
                        {if condition="in_array('Program/index',$ownways)"}
                        <li>
                            <a href="{:url('Program/index')}" class="tmp">
                                方案管理
                            </a>
                        </li>
                        {/if}
                    </ul>
                </li>
                {/if}
                {if condition="in_array('Order/index',$ownways)"}
                <li>
                    <a href="#" class="dropdown-toggle">
                        <i class="fa fa-money"></i>
                        <span>订单评审管理</span>
                        <i class="fa fa-chevron-circle-down drop-icon"></i>
                    </a>
                    <ul class="submenu">
                        <li>
                            <a href="{:url('Order/index')}" class="tmp">
                                订单评审
                            </a>
                        </li>

                    </ul>
                </li>
                {/if}
                {if condition="in_array('Execorder/index',$ownways) || in_array('Execorder/gds',$ownways)
                || in_array('Execorder/gdc',$ownways) || in_array('Execorder/gdm',$ownways)
                || in_array('Execorder/gdq',$ownways)"}
                <li>
                    <a href="#" class="dropdown-toggle">
                        <i class="fa fa-money"></i>
                        <span>订单执行管理</span>
                        <i class="fa fa-chevron-circle-down drop-icon"></i>
                    </a>
                    <ul class="submenu">
                        {if condition="in_array('Execorder/index',$ownways)"}
                        <li>
                            <a href="{:url('Execorder/index')}" class="tmp">
                                订单执行
                            </a>
                        </li>
                        {/if}
                        {if condition="in_array('Execorder/gds',$ownways)"}
                        <li>
                            <a href="{:url('Execorder/gds')}" class="tmp">
                                统计报表-国家
                            </a>
                        </li>
                        {/if}
                        {if condition="in_array('Execorder/gdc',$ownways)"}
                        <li>
                            <a href="{:url('Execorder/gdc')}" class="tmp">
                                统计报表-客户
                            </a>
                        </li>
                        {/if}
                        {if condition="in_array('Execorder/gdm',$ownways)"}
                        <li>
                            <a href="{:url('Execorder/gdm')}" class="tmp">
                                统计报表-基表型号
                            </a>
                        </li>
                        {/if}
                        {if condition="in_array('Execorder/gdq',$ownways)"}
                        <li>
                            <a href="{:url('Execorder/gdq')}" class="tmp">
                                统计报表-表计订单数量
                            </a>
                        </li>
                        {/if}

                    </ul>
                </li>
                {/if}

            </ul>
        </div>
    </section>
</div>

<script src="__JS__/jquery.js"></script>
<script src="__JS__/pagenav/jquery.singlePageNav.min.js"></script>
<script>
    //菜单动态选中 js
    //获取当前地址栏中的链接
    var urlstr = location.href;
    var urlstatus = false;
    var menu_obj = $("#menulist a");
    //遍历所有菜单
    menu_obj.each(function () {
        //判断当前菜单是否存在
        if((urlstr + '/').indexOf($(this).attr('href')) > -1 && $(this).attr('href')!='')
        {
            $(this).addClass('active');
            $(this).parent().parent().parent().addClass('active'); //针对有多级菜单选中的样式添加
            urlstatus = true;
        }
        else
        {
            $(this).parent().removeClass('active');
        }
    });
    //加载页面默认选中第一个
    /*if(!urlstatus)
    {
        menu_obj.parent().eq(0).addClass('active');
    }*/
   /* $(function () {
        $('.nav').singlePageNav({
                offset:10
        }
        );
    })*/
</script>
